trigger: none

schedules:
- cron: "0 9 * * 0"
  displayName: Sun at 1:00 AM (UTC-8:00)
  branches:
    include:
    - main
  always: true

variables:
  - template: /eng/pipelines/common/variables.yml

extends:
  template:  /eng/pipelines/common/templates/pipeline-with-resources.yml
  parameters:
    stages:
    - stage: Build
      jobs:

      - template: /eng/pipelines/common/platform-matrix.yml
        parameters:
          jobTemplate: /eng/pipelines/common/global-build-job.yml
          buildConfig: Release
          helixQueueGroup: libraries
          helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
          platforms:
          - linux_x64
          - linux_arm
          - linux_arm64
          - windows_x86
          - windows_x64
          - windows_arm64
          jobParameters:
            # Default timeout is 150 minutes (2.5 hours), which is not enough for stress.
            timeoutInMinutes: 360
            buildArgs: -s clr+libs+libs.tests -rc Checked -c $(_BuildConfig) /p:ArchiveTests=true
            postBuildSteps:
              - template: /eng/pipelines/libraries/helix.yml
                parameters:
                  creator: dotnet-bot
                  extraHelixArguments: /maxcpucount:10
                  scenarios:
                    - jitstressregs1
                    - jitstressregs2
                    - jitstressregs3
                    - jitstressregs4
                    - jitstressregs8
                    - jitstressregs0x10
                    - jitstressregs0x80
                    - jitstressregs0x1000
                    - jitstressregs0x2000
